import { BaseWindow } from "../../../../component/window/BaseWindow";
import { ILayer } from "../../../../mvc/interfaces/ILayer";
import { GButton } from "../../../../../com/mui/controls/GButton";
import { ItemData } from "../../../resource/info/ItemData";
import { PopupManager } from "../../../manager/PopupManager";
import { ObjCreate } from "../../common/ObjCreate";
import { DeployPanelItem } from "../deploy/DeployPanelItem";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { Language } from "../../../../../extend/language/Language";
import { GLabel } from "../../../../../com/mui/controls/GLabel";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class QuickOptAlertPanel
    
    export  class QuickOptAlertPanel extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            this.setSize(280, 190);
            this.titleHeight = 24;
            return;
        }

        public get btnOK(): GButton
        {
            return this._btnOK;
        }

        public set type(arg1: string)
        {
            this._type = arg1;
            return;
        }

        public set imageItemData(arg1: ItemData)
        {
            this._imageItem.itemData = arg1;
            return;
        }

        protected onButtonClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            PopupManager.removePopup(this);
            return;
        }

        protected showWarmLabel(arg1: Boolean): void
        {
            if (arg1) 
            {
                this._warmLabel.visible = true;
                this._imageItem.y = 50;
                this._nameLabel.y = 50;
                this._targetLabel.y = 70;
            }
            else 
            {
                this._imageItem.y = 70;
                this._nameLabel.y = 70;
                this._targetLabel.y = 90;
                this._warmLabel.visible = false;
            }
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            ObjCreate.createBg(16, 35, 250, 110, this);
            this._imageItem = new DeployPanelItem(0);
            this._imageItem.x = 40;
            this._imageItem.y = 50;
            this._imageItem.label = "";
            this.addChild(this._imageItem);
            this._nameLabel = ObjCreate.createLabel("", 90, 50, 160, 20, flash.text.TextFormatAlign.LEFT, this, true, 16776960);
            this._targetLabel = ObjCreate.createLabel("", 90, 70, 160, 20, flash.text.TextFormatAlign.LEFT, this, true, 16776960);
            this._warmLabel = ObjCreate.createGTextField("", 25, 100, 230, 40, this, new GTextFormat(FontUtil.songtiName, 12, 16776960, null, null, null, null, null, null, null, null, null, 5));
            this._warmLabel.wordWrap = true;
            this._warmLabel.mouseWheelEnabled = false;
            this._warmLabel.htmlText = "";
            this._btnOK = ObjCreate.createGButton(Language.getString(69901), 55, 155, 70, 28, this);
            this._btnCancel = ObjCreate.createGButton(Language.getString(69902), 162, 155, 70, 28, this);
            this._btnOK.addEventListener(flash.events.MouseEvent.CLICK, this.onButtonClick);
            this._btnCancel.addEventListener(flash.events.MouseEvent.CLICK, this.onButtonClick);
            return;
        }

        protected /* override */ createDisposedChildrenImpl(): void
        {
            super.createDisposedChildrenImpl();
            _closeBtn.configEventListener(flash.events.MouseEvent.CLICK, this.onButtonClick);
            return;
        }

        protected /* override */ updateSize(): void
        {
            super.updateSize();
            _windowCenter.height = 118;
            return;
        }

        protected /* var */_imageItem: DeployPanelItem;

        protected /* var */_nameLabel: GLabel;

        protected /* var */_targetLabel: GLabel;

        protected /* var */_warmLabel: GTextFiled;

        protected /* var */_descText: Object /* flash.text.TextField */;

        protected /* var */_btnOK: GButton;

        protected /* var */_btnCancel: GButton;

        protected /* var */_type: string;
    }
